JavaScript

{grid.object}_selectAllRowCheckboxes Method

Syntax

{grid.object}._selectAllRowCheckboxes(flag);

Arguments

flagboolean

State to select for all rows on the current Grid Page. A value of true will check all rows on the current Grid page. A value of false will uncheck all rows on the current Grid page.

Description

If a Grid has a checkbox column, sets the state of the checkbox in all rows of the Grid on the current Grid Page.

Discussion

The _selectAllRowCheckboxes() method selects all of the rows on the current grid page. This method is only available if the Checkbox Column has been enabled for the Grid Component.

// Check all rows on current page:
{grid.object}._selectAllRowCheckboxes(true);

// Uncheck all rows on current page:
{grid.object}._selectAllRowCheckboxes(false);

Unchecking All Rows Across Multiple Pages

If the Checkbox Select type is set to 'Multiple Rows', the selected rows on each page are stored in the Grid's {grid.object}._checkRowKeys array. Since _selectAllRowCheckboxes() only applies to the current Grid page, it cannot be used to uncheck selected rows that are not on the current page. Instead, you need to reset the _checkRowKeys array:

// Uncheck all rows across all pages in Grid
{grid.object}._checkedRowKeys = [];

// Refresh the Grid to update the UI:
{grid.object}.refresh();

See Also